var t = require("../common/index.js");
var app = getApp()
Component({
  properties: {
    data: {
      type: Object
    },
    floorIndex: {
      type: Number
    },
    columnCount: {
      type: Number
    },
    isExchange:{
      type: Number,
      default: 0
    },
    titleImgUrl:{
      type: String
    },
    bgColor:{
      type: String
    },
    isShowTitle:{
      type: Number,
      default: 0
    },
  },
  data: { imgurl: app.getImgUrl() },
  methods: {
    goLink: function (e) {
      if(this.data.isExchange == 1){
        // this.triggerEvent("exchange",e)
      }else{
        var o = e.currentTarget.dataset, i = o.item, a = i.id, n = i.activityId, r = o.positionIndex, s = o.timestamp, d = e.currentTarget.offsetTop;
        if (a) {
          var p = this.data.floorIndex;
          (0, t.goLink)({
            type: "shop",
            data: { item: i },
            saOption: {
              componentName: "goodsList",
              floorIndex: p,
              positionIndex: r,
              timestamp: s,
              offsetTop: d
            }
          });
        }
      }
    },
    goExchange(e){
      this.triggerEvent("exchange",e)
    },
    goProduct(e){
      this.triggerEvent("product",e)
    }
  }
});